package com.hp.springboottextcach.controller;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.hp.springboottextcach.entity.deptmber;
import com.hp.springboottextcach.entity.people;
import com.hp.springboottextcach.mapper.deptmberUs;
import com.hp.springboottextcach.mapper.peopleUs;
import com.hp.springboottextcach.service.deptmberService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

@RestController
public class deptmberController {
    Logger logger = LoggerFactory.getLogger(deptmberController.class);

    @Autowired
    deptmberService deptmberService;

    Map<String, deptmber> cityMap = new HashMap<String, deptmber>();
    @Autowired
    private RedisTemplate redisTemplate;

    private deptmber deptmber;
    @GetMapping("/test/{id}")
    public deptmber say(@PathVariable("id") Integer id) {
        deptmber ds = deptmberService.SelectAllById(id);
        logger.info(String.valueOf(ds));
        return ds;
    }

    @GetMapping("/delect/{id}")
    public void delect(@PathVariable("id") Integer id){
        int i = deptmberService.delect(id);
        logger.info("删除"+i+"条信息");
    }
    @GetMapping("/hell")
    public void test(){
        System.out.println("hollow");
    }
}